const currentHref = (() => {
    if (process.env.NODE_ENV === 'development') {
        return {
            apiPath: 'https://dev.pmad.com.cn/api',
            imgPath: 'http://img.zzha.vip',
            aboutUs: 'http://w.zzha.vip'
        };
    } else {
        return {
            apiPath: 'https://pro.pmad.com.cn/api',
            imgPath: 'http://img.zzha.vip',
            aboutUs: 'http://w.zzha.vip'
        };
    }
})();

const appConfig = {
    apiurl: currentHref.apiPath,
    picurl: currentHref.imgPath,
    aboutUs: currentHref.aboutUs
}

if(process.env.NODE_ENV === 'development') {
    if (process.env.TARO_ENV === 'weapp') {
        appConfig.token = '04e508ag1cc27dPb45D287T79n51cfq28Ne051f2cdf';
    } else if (process.env.TARO_ENV === 'alipay') {
        appConfig.token = '7d27063N0bc95aH967Zde7J5cP0eN3E24V7574e9176';
    } else if (process.env.TARO_ENV === 'swan') {
        appConfig.token = '7121076h09Sc65Kc92o831P18Wfcf8ucdQ42850da6a';
    } else if (process.env.TARO_ENV === 'h5') {
        appConfig.token = 'f3dd0b7A50Tdc9icaescc7k51Wb0w3k36S5d9f001c4'
    }
} else {
    if (process.env.TARO_ENV === 'weapp') {
        appConfig.token = '149f01bg47L4b3J49dUc9cB15F8ar8h14C7b330cdee';
    } else if (process.env.TARO_ENV === 'alipay') {
        appConfig.token = 'bbec3c7M01Ac54L118le6bU52qe0C1u56O0f72f5532';
    } else if (process.env.TARO_ENV === 'swan') {
        appConfig.token = 'dee843fx8fG70eC8a9s57cXa9m14j9y80Sd080482d1';
    } else if (process.env.TARO_ENV === 'h5') {
        appConfig.token = 'aaae590J26O8c7v946Vb51Id2Febe7d6cvce9e1c5ec'
    }
}
//  测试 appid： wx0f15e807a03df24a
//  测试 token: acde0d3x9eIbe7bc0eu8dbO6aK0fbbO20b65398d5bc

export default appConfig;
